package com.onlyMe.world.components.base
{
	import com.flesler.componentas.core.Entity;
	import com.flesler.componentas.core.base.BaseComponent;
	import com.onlyMe.base.BasicComponent;
	import com.onlyMe.world.objects.IsleObject;
	import com.qb9.flashlib.utils.ClassUtil;
	
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	
	/**
	 * @author ariel
	 */
	public class BaseIsleComponent extends BasicComponent implements IExternalizable
	{
		private var _type:String;
		
		public function BaseIsleComponent()
		{
		}
		
		override public function registerTo(entity:Entity):void
		{
			super.registerTo(entity);
			
			createLogger(object.type + ' > ' + ClassUtil.getName(this)); 
		}
		
		public function get object():IsleObject
		{
			return entity as IsleObject;
		}
		
		
		public function get type():String
		{
			return _type;
		}
		
		// Deserialization
		
		public function deserialize(xml:XML):void
		{
			_type = xml.localName() as String;
		}
		
		public function readExternal(input:IDataInput):void
		{
		}
		
		public function writeExternal(output:IDataOutput):void
		{
		}
	}

}
